package me.jiatao.wan.model

import androidx.databinding.ObservableBoolean
import androidx.databinding.ObservableField
import me.jiatao.wan.AppConfig

/**
 * @Author: taojia
 * @CreateDate: 2021/9/9 2:58 下午
 * @Version: 1.0
 * @Description:
 */

class UserInfoModel {
    val userName = ObservableField("未登录")
    val userAvatar = ObservableField("")
    val userLogin = ObservableBoolean(false)

    fun setUserName(name: String) {
        userLogin.set(true)
        userName.set(name)
        userAvatar.set(AppConfig.getPlaceImg(name))
    }

    fun logout() {
        userLogin.set(false)
        userName.set("未登录")
        userAvatar.set("")
    }
}